﻿@using WaterRevenueMS.WebUI.Extension.MvcHelper
@using WaterRevenueMS.Domain.ViewModels.Charge.ChargeRecord
@using WaterRevenueMS.Domain.ViewModels.AdminCommon
@model ChargeRecordModel

@{
    ViewBag.Title = ViewBag.CurrentTitle + " - 潍微水务管理系统";

    var editButton = new ButtonModel();
    editButton = ViewBag.Edit;
    var PrintButton = new ButtonModel();
    PrintButton = ViewBag.Edit;
}
@section css{
     <link href="@Url.Content("~/Content/themes/base/jquery.ui.core.css")" rel="Stylesheet" type="text/css"/>  
     <link href="@Url.Content("~/Content/themes/base/jquery.ui.autocomplete.css")" rel="Stylesheet" type="text/css"/> 
     <link href="@Url.Content("~/Content/themes/base/jquery.ui.datepicker.css")" rel="Stylesheet" type="text/css"/> 
     <link href="@Url.Content("~/Content/themes/base/jquery.ui.theme.css")" rel="Stylesheet" type="text/css"/> 
}

<div id="content-body" class="row-fluid">
    <div class="span22">
        <!--操作 -->
        @Html.Partial("Search", Model.Search)

        <!--列表-->
        @Html.Partial("List")

        <!--新增 & 编辑-->
        @Html.Partial("_FormModal")
    
    </div>
</div>

@section scripts{
    <script src="@Url.Content("~/Scripts/jquery-ui-1.10.4.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-zh.js")" type="text/javascript"></script>
    <script type="text/javascript">
        var oTable = null;

        $(function () {
            var actionUrl = "@Url.Action("List")?rand=" + Math.random();
            var aoColumns = [
                    { "sName": "SortId", "bSortable": false },
                    { "sName": "UserName", "bSortable": false },
                    { "sName": "Yong_HDZ", "bSortable": false },
                    { "sName": "Yong_HYE", "bSortable": false },
                    { "sName": "Ben_QDS", "bSortable": false },
                     { "sName": "Shang_QDS", "bSortable": false },
                     { "sName": "Ben_QYL", "bSortable": false },
                     { "sName": "He_JYL", "bSortable": false },
                     { "sName": "Ben_CJF", "bSortable": false },
                   { "sName": "Jiao_FJE", "bSortable": false },
                    { "sName": "CreateDT", "bSortable": false },
                    { "sName": "ReviseDT", "bSortable": false },
                     { "sName": "Jiao_FZTLX", "bSortable": false },
                     { "sName": "Bei_Z", "bSortable": false },
                      {
                        "sName": "Id",
                        "bSearchable": false,
                        "bSortable": false,
                        "fnRender": function (oObj) {
                            var btnArray = "";

                            @if (PrintButton != null)
                            {
                                <text>btnArray += '<button type="submit" class="btn btn-primary btn-normal" title="打印"  onclick="Payment(' + oObj.aData[oObj.aData.length - 1] + ')"><span class="@PrintButton.Icon"></span></button>'</text>
                               
                            }                           
                            return btnArray;
                        }
                        }
            ];
            //初始化表格
            oTable = InitDatatables($(".data-table"), actionUrl, aoColumns, oTable);
        });

                //查询
                function Search() {
                    var filterdata = $(".search-form").serialize();
                    var actionUrl = "@Url.Action("List")?rand=" + Math.random() + "&" + filterdata;
            SearchRecord(actionUrl, oTable);
        }
         


        //保存
        function Save() {
            SaveModal(oTable);
        }

        function Payment(id){
            var actionUrl="@Url.Action("Payment")";
            var param={Id:id};
            location.href=actionUrl+"?Id="+id;
        }

    </script>
}

